package com.hefeng.wx.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.hefeng.wx.domain.WxDeviceUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * @description: 设备用户绑定mapper
 * @author：  hzh
 * @datetime：  2022/9/19 10:54
 * @参数说明
 */
@Mapper
public interface WxDeviceUserMapper extends BaseMapper<WxDeviceUser> {
    /**
     * 方法说明: 获取所有用户绑定的设备编码
     * @param
     * @return 返回用户绑定设备编码 userid:deviceid,deviceid
     * @Author: huzh
     * @Date: 2022/11/1
     */
    List<Map<String,String>> getUserBindingDevice();

    @Select("SELECT\n" +
            "\twx_device_user.user_id,wx_device_user.phone\n" +
            "FROM\n" +
            "\twx_device_user\n" +
            "WHERE\n" +
            "\twx_device_user.is_delete = 1 AND\n" +
            "\twx_device_user.device_code = #{deviceCode}")
    WxDeviceUser getUser(String deviceCode);


}
